package com.nkzy.servlet; /**
 * Create by 王建烨 on 2022/4/1 11:32
 **/


import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

public class ThirdServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        // 把Get交给Post处理
        this.doPost(request,response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setHeader("content-type","text/html;charset=UTF-8");
        response.setCharacterEncoding("UTF-8");
        response.getWriter().println("<h1>嗨害嗨！Third Servlet</h1>");
        System.out.println("嗨害嗨！Third Servlet");
    }
}
